Repository navigation
feat(fleet): probe-based UDS/TCP transport selection for broker clients (#6218) - #8033
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 20 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Codex findings disposition (task 14372 resume, lane code-f): the Codex code review on commit 5d63b51 FAILED to run — Codex usage limits for code reviews reached (see the Codex bot comment above); the review posted zero findings and zero review comments. There is therefore no undispositioned Codex finding on this PR. Local verification stands as recorded on issue #6218: fleet-config 26 pass, fleet-queue --all-features 119 pass, fleet-secrets pass, fleet + fleet-dispatch suites ok. PR checks remain QUEUED under the fleet-wide Actions stall; per standing merge authority (CI runs on main only; PRs do not wait for CI) this PR merges now and main CI is the verification surface. |
Implements #6218 (from the #5699 design adopted 2026-11-05): fleet clients select UDS vs TCP per broker role by probing, instead of fixed routes.
What changed
RoleTransport+Config::role_transport_choice(role)+probe_socket(path). Selection order: the[<role>] transportconfig preference wins ("tcp" = TCP without probing, "socket" = the role's Unix socket); with no preference, probe the role socket — file exists + connect succeeds selects UDS, absent or stale selects TCP. Probe behavior is unit-tested for socket-present, socket-absent, and socket-stale cases, plus the pure preference/probe matrix.fleet-queue, client feature now depends on fleet-config):broker_sock()asks fleet-config instead of hardcoding~/.cache/laptop-agent/broker.sock(env > config file > the same compiled-in default; load error falls back to the home-anchored path).REPO_QUEUE_BROKER_URL/ broker-url file wins and gains aunix://<path>form; otherwise the probe choice for the queue-broker role selects a direct UDS roundtrip when the socket answers. A failed UDS attempt falls back to the session-proxy (TCP) route within the same call. Sandbox consumers are untouched: with no live role socket the client keeps the session-proxy route exactly as before.DirectSecrets: gains aunix://form forQUEUE_BROKER_SECRETS_URL(same GET /secret/ exchange over the secrets broker's socket; connect failure falls back to the TCP endpoint in the same resolve), and the default endpoint is probe-selected via fleet-config when no URL is configured. Response handling is shared between the legs.fleet secrets(laptop-local path): newDirectBrokerSourcein fleet-secrets speaks plain HTTP over the secrets broker's own socket, reading the broker token from its token file.Resolver::default_chainprepends it only when the probe selects the socket (laptop); on the sandbox the chain is byte-for-byte the historical shape.fleet secrets listuses the direct source on the same condition.Tests
Laptop,
pkgs/fleet:cargo test -p fleet-config— 26 passed (3 new: preference/probe matrix, probe live/absent/stale, role dispatch)cargo test -p fleet-queue --all-features— 119 passed (new: configured-URL routing, shared response parsing, DirectSecrets endpoint selection + status mapping, UDS resolve roundtrip)cargo test -p fleet-secrets— all passed (new: direct source resolve + list roundtrips over a temp socket, 404 mapping)cargo test -p fleet -p fleet-dispatch— all suites okQueue task 14372 (lane code-h, direct execution lane).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.